<template>
  <a-config-provider :locale="zhCN">
    <div class="app-container">
      <aside class="app-aside">
        <div v-for="route in menus" :key="route.path" class="menu-item">
          <router-link :to="route.path">{{ route?.meta?.title }}</router-link>
        </div>
      </aside>
      <main class="app-main">
        <router-view></router-view>
      </main>
    </div>
  </a-config-provider>  
</template>

<script setup lang="ts">
import { routes } from "@/router";
import { computed } from "vue";
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

dayjs.locale('en');
const menus = computed(() => routes);

</script>

<style scoped lang="less">
.app-container {
  display: flex;
  min-height: 100vh;
}
.app-aside {
  width: 240px;
  padding: 20px;
  border-right: 1px solid #ccc;
  .menu-item {
    margin-bottom: 10px;
    font-size: 18px;
    a {
      color: #333;
      padding: 5px 20px 5px 14px;
    }
    .router-link-exact-active {
      color: #409eff;
      text-decoration: underline;
    }
  }
}
.app-main {
  flex: 1;
  padding: 20px;
}
</style>
<style lang="less">
* {
  margin: 0;
  padding: 0;
}
</style>
